﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Windows.Forms;

namespace AnguaRPGEngine.DND4eModule
{
    public class AdventureArea
    {
        public string Name { get; set; }
        public int ExperiencePoints { get; set; }
        public string Setup { get; set; }
        public string Tactics { get; set; }
        public string AreaMapFileSpec { get; set; }
        public List<QuestionAnswer> QuestionsAnswers { get; set; }
        public string OtherInformation { get; set; }
        public List<string> ReadAloudText { get; set; }
        public List<Feature> Features { get; set; }
        #region ListView Methods
        #region Question And Answers
        public ListView.ListViewItemCollection GetQuestionAndAswerItems(ListView owner)
        {
            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(owner);
            foreach (QuestionAnswer qa in QuestionsAnswers)
            {
                items.Add(qa.Question).SubItems.Add(qa.Answer);
            }
            return items;
        }
        public static ListView.ColumnHeaderCollection GetQuestionAndAnswerHeaders(ListView owner)
        {
            return QuestionAnswer.GetColumnHeaders(owner);
        }
        #endregion
        #region Read Aloud Text
        public ListView.ListViewItemCollection GetReadAloudTextItems(ListView owner)
        {
            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(owner);
            foreach (string s in ReadAloudText)
            {
                items.Add(s);
            }
            return items;
        }
        public static ListView.ColumnHeaderCollection GetReadAloudTextHeaders(ListView owner)
        {
            ListView.ColumnHeaderCollection columns = new ListView.ColumnHeaderCollection(owner);
            columns.Add("Text", 300);
            return columns;
        }
        #endregion
        #region Features
        public ListView.ListViewItemCollection GetFeatureItems(ListView owner)
        {
            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(owner);
            foreach (Feature feat in Features)
            {
                items.Add(feat.Name).SubItems.Add(feat.Description);
            }
            return items;
        }
        public static ListView.ColumnHeaderCollection GetFeatureHeaders(ListView owner)
        {
            return Feature.GetColumnHeaders(owner);
        }
        #endregion
        public ListView.ListViewItemCollection GetAreaItems(ListView owner)
        {
            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(owner);
            ListViewItem item = new ListViewItem(Name);
            item.SubItems.Add(ExperiencePoints.ToString());
            item.SubItems.Add(AreaMapFileSpec);
            items.Add(item);
            return items;
        }
        public static ListView.ColumnHeaderCollection GetAreaHeaders(ListView owner)
        {
            ListView.ColumnHeaderCollection columns = new ListView.ColumnHeaderCollection(owner);
            columns.Add("Name", 80);
            columns.Add("XP", 30);
            columns.Add("Map", 200);
            return columns;
        }
        #endregion
    }
}
